/*
 * exceptions.h
 *
 *  Created on: Apr 15, 2009
 *      Author: Ry
 */

#ifndef EXCEPTIONS_H_
#define EXCEPTIONS_H_

#include <string>
#include <exception>

#include "export.h"

class GameException: public std::exception {
public:
	GameException(std::string message) {
		this->message = message.c_str();
	}

	GameException(){
		message = NULL;
	}

	virtual const char* what() const throw() {
		return message;
	}

	virtual ~GameException() throw() {}
protected:
	const char* message;
};

class NoCameraDefinedException: public GameException  {
public:
	NoCameraDefinedException(){
		message = "No camera is defined.  The scene cannot be drawn.";
	}
};

class FileException: public GameException  {
public:
	FileException(std::string message){
		this->message = ("File Exception: " + message).c_str();
	}
};

/**
 * Represents an exception that occurred when the graphics/input subsystem
 * has a problem
 */
class SubsystemException: public GameException  {
public:
	SubsystemException(std::string message){
		this->message = ("Subsystem Exception: " + message).c_str();
	}
};

#endif /* EXCEPTIONS_H_ */
